/*
 * Copyright (c) 2009, Jan Pastor. All Rights Reserved.
 */

package sk.jp.jitag.ui.thumb;

import java.awt.Point;
import java.awt.Component;
import java.awt.event.MouseEvent;
import javax.swing.JList;

/**
 * Mouse event re-dispatched from {@link JList} to clicked {@link FileThumbnail}
 * in list.
 */
public class ThumbnailListMouseEvent extends MouseEvent {

    private final Point absoluteLocation;

    public ThumbnailListMouseEvent(Component source, int id, long when, int modifiers,
                                   int x, int y, int clickCount, boolean popupTrigger,
                                   int button, Point absoluteLocation) {
        super(source, id, when, modifiers, x, y, clickCount, popupTrigger, button);
        this.absoluteLocation = absoluteLocation;
    }

    public ThumbnailListMouseEvent(Component source, int id, long when, int modifiers,
                                   int x, int y, int clickCount, boolean popupTrigger,
                                   Point absoluteLocation) {
        super(source, id, when, modifiers, x, y, clickCount, popupTrigger);
        this.absoluteLocation = absoluteLocation;
    }

    public Point getAbsoluteLocation() {
        return absoluteLocation;
    }

    @Override
    public String toString() {
        return "ThumbnailListMouseEvent{" +
               "absoluteLocation=" + absoluteLocation +
               "super=" + super.toString() +
               '}';
    }
}
